#include"mystdio.h"
#include<string.h>
#include<unistd.h>

int main()
{
  mFILE* fp=mfopen("log.txt","a");
  if(fp==NULL)
  {
    printf("file open fail");
    return 1;
  }
  int cnt=10;
  while(cnt--)
  {
    char buf[64];
    snprintf(buf,sizeof(buf),"hello wzz is %d\n",cnt);
    mfwrite(buf,strlen(buf),fp);
    mfflush(fp);
    sleep(1);
  }
 myclose(fp); 
  return 0;
}
